<template>
  <AConfigProvider :locale="locale" :theme="themeConfig">
    <RouterView />
  </AConfigProvider>
</template>

<script setup>
import { onBeforeMount, ref } from 'vue';
import zhCN from 'ant-design-vue/es/locale/zh_CN';
import dayjs from 'dayjs';
import 'dayjs/locale/zh-cn';

import { useAppStore } from './store';

dayjs.locale('zh-cn');

const { themeConfig, setupTheme } = useAppStore();

onBeforeMount(() => {
  setupTheme(document.body);
});

const locale = ref(zhCN);
</script>
